package dto

import (
	"tuowei.com/app/admin/models"
	"tuowei.com/common/dto"
)

// 学员管理列表
type GetManageStudentsListsRequest struct {
	dto.Pagination `search:"-"`
	Area           int    `json:"area" form:"area"` // 区域
	Label          string `json:"label" form:"label"`
	State          int    `json:"state" form:"state"`
	Name           string `json:"name" form:"name"`
	Divided        *bool  `json:"divided" form:"divided"`
}

type GetStudentDetailRequest struct {
	Id int `json:"id" form:"id" search:"type:exact;column:id;table:sys_student" binding:"required"`
}

type GetStudentsListRequest struct {
	dto.Pagination `search:"-"`
	Divided        *int `json:"divided" form:"divided" comment:"状态"` // 0-未分班，1-已分班
}
type SubmitCommunicationRequest struct {
	// 订单id
	OrderId int `json:"order_id" search:"type:exact;column:id,table:sys_offline_order" binding:"required"`
	// 沟通急哦路
	Communication string `json:"communication"`
	// 合同单号
	ContractNo string `json:"contract_no" binding:"required"`
	// 是否付款
	Payed bool `json:"payed"`
}

func (sub *SubmitCommunicationRequest) Generate(model *models.OfflineOrder) {
	model.Id = sub.OrderId
	model.Communication = sub.Communication
	model.ContractNo = sub.ContractNo
	// 流程上应该是由待跟进变成已跟进3，已经付款，状态直接变成财务复审状态4
	model.Status = 3
	if sub.Payed {
		model.Status = 4
	}
}

func (sub *SubmitCommunicationRequest) GetId() interface{} {
	return sub.OrderId
}

type StudentOrderHistoryListRequest struct {
	Id int `json:"id" form:"id"  binding:"required"`
	dto.Pagination
}

type DivisionStudentRequest struct {
	Ids     []int `json:"ids" binding:"required"`
	ClassId int   `json:"class_id" binding:"required"`
}

type GetClassRequest struct {
	AreaId int `uri:"area_id" binding:"required"`
}

type GetStudentsInvitedRequest struct {
	dto.Pagination
}

type GetMyStudentsRequest struct {
	dto.Pagination `search:"-"`
	// 学员类型
	Label string `json:"label" form:"label" search:"type:exact;column:user_type;table:sys_student" `
}

func (m *GetMyStudentsRequest) GetNeedSearch() interface{} {
	return *m
}

// 学员管理首页请求req

type StudentIndexRequest struct {
}
